From: Eli Zaretskii Date: Sat, 13 Jan 2007 21:46:28 +0000 (+0000) Subject: (maybe_resize_hash_table): Copy new size of hash table into EMACS_INT to avoid X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~2858 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=c434b881f8d9caa7e13df7f5f01b9ca05c5f63c0;p=emacs.git (maybe_resize_hash_table): Copy new size of hash table into EMACS_INT to avoid GCC warnings. --- diff --git a/src/fns.c b/src/fns.c index f65375438fa..1297e18f292 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4668,6 +4668,7 @@ maybe_resize_hash_table (h) { int old_size = HASH_TABLE_SIZE (h); int i, new_size, index_size; + EMACS_INT nsize; if (INTEGERP (h->rehash_size)) new_size = old_size + XFASTINT (h->rehash_size); @@ -4677,7 +4678,10 @@ maybe_resize_hash_table (h) index_size = next_almost_prime ((int) (new_size / XFLOATINT (h->rehash_threshold))); - if (max (index_size, 2 * new_size) > MOST_POSITIVE_FIXNUM) + /* Assignment to EMACS_INT stops GCC whining about limited range + of data type. */ + nsize = max (index_size, 2 * new_size); + if (nsize > MOST_POSITIVE_FIXNUM) error ("Hash table too large to resize"); h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil);